<?php
include_only();

$ffmpegpath = "/usr/bin/ffmpeg";

	function make_jpg($input, $output, $fromdurasec="01") {
		global $ffmpegpath;
		if(!file_exists($input)) return false;
				
		$command = "$ffmpegpath -i $input -an -ss 00:00:$fromdurasec -r 1 -vframes 1 -f mjpeg -y $output";
		
		@exec( $command, $ret );
		if(!file_exists($output)) return false;
		if(filesize($output)==0) return false;
		return true;
	}

	#extract frame at 00:00:01 as jpeg
make_jpg("videos/1301857880.flv", "thumbnails/1301857880.flv", "01");
	?>